package org.jeecg.talentCooperation.fruit.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.talentCooperation.fruit.entity.Fruit;
import org.jeecg.talentCooperation.fruit.mapper.FruitMapper;
import org.jeecg.talentCooperation.fruit.mapper.FruitResultMapper;
import org.jeecg.talentCooperation.fruit.model.FruitInfoResultModel;
import org.jeecg.talentCooperation.fruit.model.FruitResultModel;
import org.jeecg.talentCooperation.fruit.service.IFruitService;
import org.jeecg.talentCooperation.talent.entity.TalentBasic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FruitServiceImpl extends ServiceImpl<FruitMapper, Fruit> implements IFruitService {

    @Autowired
    private FruitMapper fruitMapper;

    @Override
    public List<FruitResultModel> getFruitIdGroupByAuthorId() {
        return fruitMapper.getFruitIdGroupByAuthorId();
    }

    @Override
    public Page<Fruit> getFruitList(Page<Fruit> page, FruitInfoResultModel fruit) {
        return page.setRecords(fruitMapper.getFruitList(page, fruit));
    }

    @Override
    public FruitInfoResultModel getDetailFruitById(Long id) {
        return fruitMapper.getDetailFruitById(id);
    }
}
